goog.provide('BombBall.Map');

goog.require('Stefan.Rect');
goog.require('Stefan.Layer');
goog.require('BombBall.Ball');

BombBall.Map = T.lang.createClass(function(config) {
	this.config = config = config || {};
	this.bg = config.background || '../td/img/ground.gif';
	this.width = BombBall.STAGE_WIDTH;	//地图宽度
	this.height = BombBall.STAGE_HEIGHT;	//地图高度
	this.time = 3000;
	
	Stefan.Layer.call(this, document.body, {
		width: this.width,
		height: this.height,
		left: this.pX,
		top: this.pY
	});
	
	this.initGrids();
}, {
	superClass: Stefan.Layer
}).extend({
	initGrids: function() {
		this.balls = [];
		this.background = new Stefan.Rect();
		this.background.setSize(this.width, this.height).setFill(this.bg);	//设置位置is.setPosition(this.pX, this.pY).setSize(this.width, this.height);is.appendChild(this.background);
		this.appendChild(this.background);
		var hole = new Stefan.Circle();
		hole.setSize(80,80);
		hole.setPosition(0,0);
		hole.setFill('rgb(10,10,10,.9)');
		this.appendChild(hole);
		
		var b = new BombBall.Ball({
			x: 300
			,y: 300
			,map: this
			,color: 'rgba(255,255,255,.8)'
			,draggable: true
			,speed_x: 1
			,speed_y: 1
		});
	}
});
